<html>
<head><meta charset="utf-8"><title>iOS Bitcode · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/iOS.20Bitcode.html">iOS Bitcode</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="174155001"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/iOS%20Bitcode/near/174155001" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Adam Fish <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/iOS.20Bitcode.html#174155001">(Aug 26 2019 at 16:08)</a>:</h4>
<p>Hi! My company has been building with Rust to create a cross-platform SDK and iOS is a major market. We have been trying to figure out how to make bitcode support work, following the various threads: <a href="https://github.com/rust-lang/rust/issues/35968" target="_blank" title="https://github.com/rust-lang/rust/issues/35968">https://github.com/rust-lang/rust/issues/35968</a>. It seems there is an incompatibility with LLVM and there is a general challenge in keeping up with the changes Apple makes. We would be happy to help but are not sure where to start. Furthermore, our company would be willing to financially support the effort entirely if someone else can assist? Who would be the best to talk to about this? Thanks!</p>



<a name="174175508"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/iOS%20Bitcode/near/174175508" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/iOS.20Bitcode.html#174175508">(Aug 26 2019 at 20:47)</a>:</h4>
<p>This is a difficult issue for officially distributed rustc, but I think it should be fairly easy to match the versions if you compile rustc with <code>system-llvm</code> support; if apple allows for that, at least.</p>



<a name="174176108"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/iOS%20Bitcode/near/174176108" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/iOS.20Bitcode.html#174176108">(Aug 26 2019 at 20:55)</a>:</h4>
<p>Do keep in mind that whenever you're shipping a rustc based on an unusual LLVM version, the bulk of the difficulty is not making rustc compile but finding &amp; handling the various small bugs which invariably exists in any given snapshot of LLVM. The rustc-picked LLVM probably has about as many of those as any other random revision, but there's a rather big community testing it, filing bugs, minimizing reproducers, and importing the bug fixes that happen upstream. If you ship a rustc with a different LLVM, you're more on your own with those tasks.</p>



<a name="174644766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/iOS%20Bitcode/near/174644766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Adam Fish <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/iOS.20Bitcode.html#174644766">(Sep 01 2019 at 03:41)</a>:</h4>
<p>Thanks for the replies, sorry I didn’t have notifications to see them! I will try compiling with older LLVM but my real hope was to get something more built in for this and to enable it for others since it is clear from the issues this is a deal breaker for some looking at the language. Do you see anyway that this could be possible?</p>



<a name="174683573"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/iOS%20Bitcode/near/174683573" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/iOS.20Bitcode.html#174683573">(Sep 02 2019 at 00:48)</a>:</h4>
<p>Petition Apple to either use a stock LLVM or make public (or at least linkable) their LLVM.</p>



<a name="174683587"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/iOS%20Bitcode/near/174683587" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/iOS.20Bitcode.html#174683587">(Sep 02 2019 at 00:49)</a>:</h4>
<p>As long as Apple has no intent on allowing other languages be first class citizens on iOS devices, it will not happen.</p>



<a name="174928670"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/iOS%20Bitcode/near/174928670" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Adam Fish <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/iOS.20Bitcode.html#174928670">(Sep 04 2019 at 22:29)</a>:</h4>
<p>That’s disappointing since I assume you know how tall of a request that is. If there was a way to get the community to test when each new build of Xcode came out, this seems a bit more achievable?</p>



<a name="174938333"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/iOS%20Bitcode/near/174938333" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/iOS.20Bitcode.html#174938333">(Sep 05 2019 at 01:57)</a>:</h4>
<p>The problem is IIRC is that you cannot link to the Apple’s LLVM at all in the first place, because they do not ship something necessary to do that. We can try linking to a similar version of LLVM, but since apple modifies their own, it is likely that those versions will be incompatible in one way or another.</p>



<a name="174938378"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/iOS%20Bitcode/near/174938378" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/iOS.20Bitcode.html#174938378">(Sep 05 2019 at 01:58)</a>:</h4>
<p>I know I originally suggested <code>use-system-llvm</code> but I had forgotten about that particular detail back then</p>



<a name="174938385"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/iOS%20Bitcode/near/174938385" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/iOS.20Bitcode.html#174938385">(Sep 05 2019 at 01:58)</a>:</h4>
<p>This overall means that for a good support of this use-case we need to get Apple to make it possible to link to its LLVM.</p>



<a name="174938411"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/iOS%20Bitcode/near/174938411" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/iOS.20Bitcode.html#174938411">(Sep 05 2019 at 02:00)</a>:</h4>
<p>otherwise you will end up threading a thin line which might not appear to be broken based on the superficial testing we could do.</p>



<a name="174938523"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/iOS%20Bitcode/near/174938523" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/iOS.20Bitcode.html#174938523">(Sep 05 2019 at 02:01)</a>:</h4>
<p>I still think that <code>use-system-llvm</code> with whatever workarounds necessary to make it work, will be the best way forward for anybody wanting to pursue this use-case</p>



<a name="174938569"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/iOS%20Bitcode/near/174938569" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/iOS.20Bitcode.html#174938569">(Sep 05 2019 at 02:02)</a>:</h4>
<p>(this might involve e.g. using the header files from public LLVM and attempting to link against apples llvm dylib, if it exists at all)</p>



<a name="174938575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/iOS%20Bitcode/near/174938575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/iOS.20Bitcode.html#174938575">(Sep 05 2019 at 02:02)</a>:</h4>
<p>(if it doesn’t then all the bets are pretty much off)</p>



<a name="174948456"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/iOS%20Bitcode/near/174948456" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Adam Fish <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/iOS.20Bitcode.html#174948456">(Sep 05 2019 at 06:30)</a>:</h4>
<p>Ok that helps clarify, I had forgotten that there is a potential distinction between what Apple is using and public. Thank you for discussing.</p>



<a name="176293512"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/iOS%20Bitcode/near/176293512" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Adam Fish <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/iOS.20Bitcode.html#176293512">(Sep 22 2019 at 04:29)</a>:</h4>
<p>Just wanted to share that we published this toolchain to help others with bitcode: <br>
<a href="https://github.com/getditto/rust-bitcode" target="_blank" title="https://github.com/getditto/rust-bitcode">https://github.com/getditto/rust-bitcode</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>